Integrand size = 27, antiderivative size = 422 \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=-\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 b \sqrt {a+b \tan (c+d x)}}{d} \]
[Out]
Time = 0.58 (sec) , antiderivative size = 422, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3609, 12, 3566, 722, 1108, 648, 632, 212, 642} \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=-\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}+\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}+\frac {b \sqrt {a^2+b^2} \log \left (-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \tan (c+d x)}+\sqrt {a^2+b^2}+a+b \tan (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}-\frac {b \sqrt {a^2+b^2} \log \left (\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \tan (c+d x)}+\sqrt {a^2+b^2}+a+b \tan (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}+\frac {2 b \sqrt {a+b \tan (c+d x)}}{d} \]
[In]
[Out]
Rule 12
Rule 212
Rule 632
Rule 642
Rule 648
Rule 722
Rule 1108
Rule 3566
Rule 3609
Rubi steps \begin{align*} \text {integral}& = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}+\int \frac {-a^2-b^2}{\sqrt {a+b \tan (c+d x)}} \, dx \\ & = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}+\left (-a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \tan (c+d x)}} \, dx \\ & = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}-\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+x} \left (b^2+x^2\right )} \, dx,x,b \tan (c+d x)\right )}{d} \\ & = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}-\frac {\left (2 b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a^2+b^2-2 a x^2+x^4} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{d} \\ & = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}-x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d} \\ & = \frac {2 b \sqrt {a+b \tan (c+d x)}}{d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d} \\ & = \frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 b \sqrt {a+b \tan (c+d x)}}{d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \tan (c+d x)}\right )}{d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \tan (c+d x)}\right )}{d} \\ & = -\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \tan (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \tan (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {2 b \sqrt {a+b \tan (c+d x)}}{d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.26 (sec) , antiderivative size = 157, normalized size of antiderivative = 0.37 \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=\frac {\cos (c+d x) (a-b \tan (c+d x)) \left (i \sqrt {a-i b} (a+i b) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )-i (a-i b) \sqrt {a+i b} \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )+2 b \sqrt {a+b \tan (c+d x)}\right )}{d (a \cos (c+d x)-b \sin (c+d x))} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(813\) vs. \(2(341)=682\).
Time = 0.07 (sec) , antiderivative size = 814, normalized size of antiderivative = 1.93
method | result | size |
parts | \(\frac {b \left (2 \sqrt {a +b \tan \left (d x +c \right )}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (a -\sqrt {a^{2}+b^{2}}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (\sqrt {a^{2}+b^{2}}-a \right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{d}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}}{4 b d}+\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) \sqrt {a^{2}+b^{2}}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 b d}-\frac {b \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}}{4 d b}-\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a}{4 d b}+\frac {b \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\) | \(814\) |
derivativedivides | \(\text {Expression too large to display}\) | \(2285\) |
default | \(\text {Expression too large to display}\) | \(2285\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 719 vs. \(2 (343) = 686\).
Time = 0.27 (sec) , antiderivative size = 719, normalized size of antiderivative = 1.70 \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=-\frac {d \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {b \tan \left (d x + c\right ) + a} + {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} + {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - d \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {b \tan \left (d x + c\right ) + a} - {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} + {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - d \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {b \tan \left (d x + c\right ) + a} + {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} - {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) + d \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {b \tan \left (d x + c\right ) + a} - {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} - {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - 4 \, \sqrt {b \tan \left (d x + c\right ) + a} b}{2 \, d} \]
[In]
[Out]
\[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=- \int a \sqrt {a + b \tan {\left (c + d x \right )}}\, dx - \int \left (- b \sqrt {a + b \tan {\left (c + d x \right )}} \tan {\left (c + d x \right )}\right )\, dx \]
[In]
[Out]
Exception generated. \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Timed out. \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Time = 10.21 (sec) , antiderivative size = 581, normalized size of antiderivative = 1.38 \[ \int (-a+b \tan (c+d x)) \sqrt {a+b \tan (c+d x)} \, dx=\mathrm {atanh}\left (\frac {d^3\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}+\frac {16\,a\,b^2\,\left (a^3+1{}\mathrm {i}\,b\,a^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}+\mathrm {atanh}\left (\frac {d^3\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}-\frac {16\,a\,b^2\,\left (-a^3+a^2\,b\,1{}\mathrm {i}\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}\right )}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}+\frac {2\,b\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d}-\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}+\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {a\,b^2-b^3\,1{}\mathrm {i}}{4\,d^2}}\,2{}\mathrm {i}+\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}-\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {b^3\,1{}\mathrm {i}+a\,b^2}{4\,d^2}}\,2{}\mathrm {i} \]
[In]
[Out]